﻿// Decompiled with JetBrains decompiler
// Type: System.Web.Razor.Utils.DisposableAction
// Assembly: System.Web.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// MVID: 682513D6-F37E-48AC-9909-F3EE103CFF14
// Assembly location: D:\Project\Idea\无人机外网\uav\客户端工程\排查工具\bin\Release\System.Web.Razor.dll

namespace System.Web.Razor.Utils
{
  internal class DisposableAction : IDisposable
  {
    private Action _action;

    public DisposableAction(Action action) => this._action = action != null ? action : throw new ArgumentNullException(nameof (action));

    public void Dispose()
    {
      this.Dispose(true);
      GC.SuppressFinalize((object) this);
    }

    protected virtual void Dispose(bool disposing)
    {
      if (!disposing)
        return;
      this._action();
    }
  }
}
